package main

import (
	linq "github.com/ahmetalpbalkan/go-linq"
	"fmt"
)

type Car struct {
	year int
	owner string
	model string
}

func main() {
	var owners []string

	cars := []Car{
		{year: 2015, owner: "test001", model: "jetta"},
		{year: 2015, owner: "test001", model: "passat"},
		{year: 2017, owner: "test001", model: "golf"},
	}

	linq.From(cars).Where(func(c interface{}) bool {
		return c.(Car).year >= 2015
	}).Select(func(c interface{}) interface{} {
		return c.(Car).owner
	}).ToSlice(&owners)

	fmt.Printf("%+v", owners)
}